package com.thrsdk.constants;

import android.text.TextUtils;

import com.thrsdk.model.protocol.bean.LoginMessage;


public class AppConstants {
    public static boolean alreadyLoadApplication = false;
    //App初始化信息
    public static String appId = "";
    public static String appKey = "";
    public static String sdkVer = "";

    //用户相关信息
    public static String openId;
    public static String token;
    public static int isautonym = 0;   //  新增实名参数  1是已实名  0是未实名
    public static int isnonage = 0;     //  新增实名参数  1是未成年人  0是成年人


    //登录判断
    public static boolean isLogin() {
        return !TextUtils.isEmpty(openId) && !TextUtils.isEmpty(token);
    }


    //退出
    public static void setLoginOut() {
        openId = "";
        token = "";
    }

    //保存用户信息
    public static void setLoginInfo(LoginMessage message) {
        openId = message.getOpenId();
        token = message.getToken();
    }
}
